import bean.Students;
import service.StudentImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.awt.*;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:spring_butler.xml")
public class tian {
    @Autowired
    StudentImpl studentImpl;
    @Test
    public void   test(){
        studentImpl.addStudent("2023032301","张三","男","计算机科学与技术","二年级");
        studentImpl.addStudent("2023032302","李四","男","计算机科学与技术","二年级");
        studentImpl.addStudent("2023032303","王五","男","计算机科学与技术","二年级");
    }
    @Test
    public void   test1(){
        studentImpl.updateStudent("202303230111","王五","男","软件231","二年级");
    }
    @Test
    public void   test2(){
        List<Students> hong = studentImpl.findAll();
        System.out.println(hong);
    }
    @Test
    public void   test3(){
        Students hong = studentImpl.findStudent("张三");
        System.out.println(hong);
    }
}
